Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only migrate active and disable connection #9454

Merged
merged 3 commits into from
Jan 13, 2022

Conversation

benmoriceau
Copy link
Contributor

What

Filter out the deleted workflows.

Change a log to the right level.

@@ -234,13 +232,13 @@ public static void main(final String[] args) throws IOException, InterruptedExce
configs.getDatabaseUser(),
configs.getDatabasePassword(),
configs.getDatabaseUrl())
.getInitialized();
.getInitialized();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need to run gw format

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -235,14 +236,15 @@ private static void migrateExistingConnection(final ConfigRepository configRepos
throws JsonValidationException, ConfigNotFoundException, IOException {
LOGGER.info("Start migration to the new scheduler...");
final Set<UUID> connectionIds =
configRepository.listStandardSyncs().stream().map(standardSync -> standardSync.getConnectionId()).collect(Collectors.toSet());
configRepository.listStandardSyncs().stream()
.filter(standardSync -> standardSync.getStatus() == Status.ACTIVE || standardSync.getStatus() == Status.INACTIVE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning behind filtering down to only ACTIVE and INACTIVE?

Copy link
Contributor Author

@benmoriceau benmoriceau Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACTIVE = enabled connections
INACTIVE = disabled connections
DEPRECATED = deleted connections

We need to start the enabled ones for an obvious reason. The disabled ones need to be started too so it can be re-enable later on. The workflow will await forever if it is disabled (like if it was a manual workflow).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense to me. Though we should probably get a confirmation from @jrhizor to be sure

@benmoriceau benmoriceau temporarily deployed to more-secrets January 12, 2022 21:47 Inactive
@benmoriceau benmoriceau requested a review from lmossman January 12, 2022 22:13
@benmoriceau benmoriceau temporarily deployed to more-secrets January 12, 2022 22:42 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 13, 2022 01:16 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 13, 2022 01:48 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 13, 2022 15:19 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 13, 2022 15:28 Inactive
@benmoriceau benmoriceau merged commit a495917 into master Jan 13, 2022
@benmoriceau benmoriceau deleted the bmoric/migrate-active-wf-only branch January 13, 2022 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants